<template>
  <div class="pagination-box">
    <el-pagination
      background
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="pageNum"
      :page-sizes="[10, 20, 30, 40]"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next"
      :total="totalNum">
    </el-pagination>
  </div>
</template>

<script>

  export default {
    name: 'pagination',
    props: {
      totalNum: {
        default: 0,
        type: Number
      }
    },
    data () {
      return {
        pageNum: 1,
        pageSize: 10
      }
    },
    created () {
    },
    mounted () {
    },
    methods: {
      handleSizeChange(val) {
        this.pageSize = val;
        this.$emit('pageSize', val)
      },
      handleCurrentChange(val) {
        this.pageNum = val;
        this.$emit('pageNum', val)
      }
    }
  }
</script>

<style>
 .pagination-box{text-align: center; padding-top: 30px;}
</style>
